// import $ from "jquery"
// const teacher: string = 'dell';
// console.log(teacher)
// d.ts文件 类型定义文件
// $(function(){
//   $('body').html("<div>123</div>")
//   new $.fn.init()
// })
interface Person {
  name: String;
  age: number;
  gender: string;
}
class Teacher {
  constructor(private info:Person) {

  }
  // keyof 对Person接口里每一个属性进行遍历
  getInfo<T extends keyof Person>(key:T):Person[T] {
    return this.info[key]
  }
}

const teacher = new Teacher({
  name: "dell",
  age: 18,
  gender: "male"
})

const test = teacher.getInfo("age")
console.log(test)